<?php /*a:1:{s:102:"/Users/juyaobin/Desktop/Site/app/serverLocalhost/view/ClassifiedAndTags/TagCatalogue/TagCatalogue.html";i:1596981430;}*/ ?>
<!DOCTYPE html>
<html class="iframe-h">

<head>
	<meta charset="UTF-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport"
		content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>网站后台管理模版</title>
	<link rel="stylesheet" type="text/css" href="/public/static/admin/layui/css/layui.css" />
	<link rel="stylesheet" type="text/css" href="/public/static/admin/css/admin.css" />
	<meta name="referrer" content="no-referrer" /><!-- 头部403 -->
	<script src="/public/static/admin/js/jquery.js"></script>
	<script src="/public/static/button.js" type="text/javascript" charset="utf-8"> </script>
	<style>
		body .layer-test {
			background: none;
			box-shadow: none;
		}

		/* 定制化 */
		html .layui-layer-demo {
			background-color: #eee;
		}

		.layui-layer-demo .layui-layer-title {
			border: none;
			background-color: #333;
			color: #fff;
		}

		.long-hidde {
			/* 超出隐藏 */
			width: 20%;
			/* 要显示文字的宽度 */
			float: left;
			/* 左对齐，不设置的话只在IE下好用 */
			overflow: hidden;
			/* 超出的部分隐藏起来 */
			white-space: nowrap;
			/* 不显示的地方用省略号...代替 */
			text-overflow: ellipsis;
			/* 支持 IE */
			-o-text-overflow: ellipsis;
			/* 支持 Opera */
		}
	</style>
	<script src="/public/static/admin/js/layer/layer.js"></script>
</head>

<body>
	<div class="wrap-container clearfix">
		<div class="column-content-detail">
			<a style="color:red">请注意 这一个无可厚非的选项 他只会从标签分类中删除 这个候选词 还是可以再次被创建的 但是设置为禁止 可以 禁止选择此关键词 </a>
			<div class="layui-form" id="table-list">
				<table class="layui-table" lay-even lay-skin="nob">
					<colgroup>
						<col class="hidden-xs" style="max-width: 20%">
						<col class="hidden-xs" style="max-width: 20%">
						<col class="hidden-xs" style="max-width: 20%">
						<col class="hidden-xs" style="max-width: 20%">
						<col class="hidden-xs" style="max-width: 20%">
					</colgroup>
					<thead>
						<tr>
							<th style="text-align:center;" class="hidden-xs">名称</th>
							<th style="text-align:center;">🆔</th>
							<th style="text-align:center;">状态</th>
							<th style="text-align:center;" class="hidden-xs">是否启用</th>
							<th style="text-align:center;" class="hidden-xs">操作</th>
						</tr>
					</thead>
					<tbody name='classifiedList'>
						<?php if(is_array($tagList) || $tagList instanceof \think\Collection || $tagList instanceof \think\Paginator): $i = 0; $__LIST__ = $tagList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tagListValue): $mod = ($i % 2 );++$i;?>

						<tr data-title="<?php echo htmlentities($tagListValue['tag_name']); ?>" data-tag-id="<?php echo htmlentities($tagListValue['_id']); ?>">
							<td><?php echo htmlentities($tagListValue['tag_name']); ?></td>

							<td class="hidden-xs">
								<p style="text-align: center;"><?php echo htmlentities($tagListValue['_id']); ?></p>
							</td>
							<td>
								<?php if($tagListValue['state'] ==1): ?>
								<button class="layui-btn layui-btn-mini layui-btn-normal button-state">启用</button>
								<?php else: ?>
								<button class="layui-btn layui-btn-mini layui-btn-danger button-state">禁用</button>
								<?php endif; ?>
							</td>
							<td class="hidden-xs"><?php echo htmlentities($tagListValue['creator']); ?></td>
							<td>
								<div class="layui-inline" data-title="<?php echo htmlentities($tagListValue['_id']); ?>">
									<button title="删除"
										class="layui-btn layui-btn-small layui-btn-danger button-delete-tag">
										<i class="layui-icon">&#xe640;</i>
									</button>
								</div>
							</td>
						</tr>
						<?php endforeach; endif; else: echo "" ;endif; ?>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	<script src="/public/static/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script src="/public/static/admin/js/common.js" type="text/javascript" charset="utf-8"></script>
	<script src="/public/static/admin/js/main.js" type="text/javascript" charset="utf-8"></script>
	<script>
		var token = "<?php echo htmlentities($hashHmac_toKen); ?>";
		var controller = "<?php echo htmlentities($url); ?>serverLocalhost/"; //当前控制器路径
	</script>
	<script>
		$(document).on("click", "button.button-state", function () { //删除漫画
			var title = $(this).parent().parent().attr('data-title');
			var tag_id = $(this).parent().parent().attr('data-tag-id');
			var me = $(this);
			$.ajax({
				type: "post",
				url: controller + "Classified/TagCatalogue/updateState?tag_id=" + tag_id,
				data: {
					"title": title,
					"tag_id": tag_id,
					"token": token,
				},
				dataType: "json",
				success: function (response) {
					if (response.code == 200) {
						layer.open({
							type: 0,
							skin: 'layui-layer-demo', //样式类名
							title: "操作成功",
							closeBtn: 0, //不显示关闭按钮
							anim: 2,
							maxWidth: '50%',
							maxHeight: '50%',
							shadeClose: false, //开启遮罩关闭
							content: '<div style="max-width:100%">' +
								'<li style="text-align:center;" class="layer-area">' +
								'<div style="text-align:center;">' +
								'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/481b5ceef0d56aa329652b269f5a02f447503e7b.png">' +
								'<div style="text-align:center;">' +
								'<font>操作成功</font>' +
								'</div>' +
								'</div>' +
								'</li>' +
								'</div>',
							btn: ['确认',] //可以无限个按钮
							,
							btn1: function (index, layero) {
								if (response.data.state) {
									me.html('启用')
									me.addClass('layui-btn-normal');
									me.removeClass('layui-btn-danger');

								} else {
									me.html('禁用')
									me.removeClass('layui-btn-normal');
									me.addClass('layui-btn-danger');

								}

								layer.close(index);
							}
						});
					} else {
						layer.open({
							type: 0,
							skin: 'layui-layer-demo', //样式类名
							title: "发生意外错误",
							closeBtn: 0, //不显示关闭按钮
							anim: 2,
							maxWidth: '50%',
							maxHeight: '50%',
							area: ['25%', '60%'],
							shadeClose: false, //开启遮罩关闭
							content: '<div style="max-width:100%">' +
								'<li style="text-align:center;" class="layer-area">' +
								'<div style="text-align:center;">' +
								'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/89f61ba7b2456dfd5af4bd92b485553274f73ad4.png">' +
								'<div style="text-align:center;">' +
								'<font>' + response.error + '</font>' +
								'</div>' +
								'</div>' +
								'</li>' +
								'</div>',
							btn: ['确认',] //可以无限个按钮
							,
							btn1: function (index, layero) {
								window.location.reload();
							}
						});
					}
				}
			});
		})
		$(document).on("click", "button.button-delete-tag", function () { //删除漫画
			var title = $(this).parent().parent().parent().attr('data-title');
			var tag_id = $(this).parent().parent().parent().attr('data-tag-id');
			var me = $(this);
			$.ajax({
				type: "post",
				url: controller + "Classified/TagCatalogue/tagDelete?tag_id=" + tag_id,
				data: {
					"title": title,
					"tag_id": tag_id,
					"token": token,
				},
				dataType: "json",
				success: function (response) {
					if (response.code == 200) {
						layer.open({
							type: 0,
							skin: 'layui-layer-demo', //样式类名
							title: "操作成功",
							closeBtn: 0, //不显示关闭按钮
							anim: 2,
							maxWidth: '50%',
							maxHeight: '50%',
							shadeClose: false, //开启遮罩关闭
							content: '<div style="max-width:100%">' +
								'<li style="text-align:center;" class="layer-area">' +
								'<div style="text-align:center;">' +
								'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/481b5ceef0d56aa329652b269f5a02f447503e7b.png">' +
								'<div style="text-align:center;">' +
								'<font>操作成功</font>' +
								'</div>' +
								'</div>' +
								'</li>' +
								'</div>',
							btn: ['确认',] //可以无限个按钮
							,
							btn1: function (index, layero) {
								if (response.data.state) {
									me.html('启用')
									me.addClass('layui-btn-normal');
									me.removeClass('layui-btn-danger');

								} else {
									me.html('禁用')
									me.removeClass('layui-btn-normal');
									me.addClass('layui-btn-danger');

								}

								layer.close(index);
							}
						});
					} else {
						layer.open({
							type: 0,
							skin: 'layui-layer-demo', //样式类名
							title: "发生意外错误",
							closeBtn: 0, //不显示关闭按钮
							anim: 2,
							maxWidth: '50%',
							maxHeight: '50%',
							area: ['25%', '60%'],
							shadeClose: false, //开启遮罩关闭
							content: '<div style="max-width:100%">' +
								'<li style="text-align:center;" class="layer-area">' +
								'<div style="text-align:center;">' +
								'<img  draggable="false" style="max-Width:70%;max-height:60%;" src="https://i0.hdslb.com/bfs/album/89f61ba7b2456dfd5af4bd92b485553274f73ad4.png">' +
								'<div style="text-align:center;">' +
								'<font>' + response.error + '</font>' +
								'</div>' +
								'</div>' +
								'</li>' +
								'</div>',
							btn: ['确认',] //可以无限个按钮
							,
							btn1: function (index, layero) {
								window.location.reload();
							}
						});
					}
				}
			});
		})
	</script>
</body>

</html>